<style>

</style>

<div>
    <div class="card">
        <div class="card-title" style="display: flex; justify-content: space-between; margin: 20px">
            <div>支出历史（按照时间倒序）</div>
            <a href="{{route('admin.running-water.index')}}" type="button" class="btn btn-primary">去未收账单界面</a>
        </div>
        <div class="card-body">
            @foreach($owner->items as $key => $value)
            <div class="card">
                <div class="card-body" style="display: flex; justify-content: space-between; margin: 10px; align-items: center">
                    <div>记录{{ $key + 1 }}.&nbsp;&nbsp;&nbsp;支付时间： {{$value->pay_at}}&nbsp;&nbsp;&nbsp; --------- &nbsp;&nbsp;&nbsp;金额： {{$value->total_amount}}</div>
                    <div><a target="_blank" href="{{route('admin.pending-bill.pdf', ['bill' => $value->id])}}"
                            type="button" class="btn btn-primary">查看账单</a></div>
                </div>
            </div>
            @endforeach
        </div>
    </div>
</div>

<script>
    Dcat.ready(function () {
        $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            }
        });
    });
</script>